{layout name="layout" /}

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header layuiadmin-card-header-auto"></div>
        <div class="layui-card-body">
            <table id="zbc-wechat-reply" lay-filter="zbc-wechat-reply"></table>
        </div>
    </div>
</div>

<script type="text/html" id="toolbarDemo">
    <div class="layui-btn-container">
        <button class="layui-btn layuiadmin-btn-useradmin" data-type="batchdel">删除</button>
        <button class="layui-btn layuiadmin-btn-useradmin" data-type="add">添加</button>
    </div>
</script>

<script type="text/html" id="table-content-operation">
    <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
</script>

<script type="text/html" id="table-content-enabled">
    {{d.useUrl=="1"?"使用":"不使用"}}
</script>

<script>
 layui.config({
    base:'/static/layuiadmin/'
 }).extend({
    index: 'lib/index' //主入口模块
 })
 .use(["index","curdtable"],function(index,curdtable){
    curdtable.init({
        TABLEID:"zbc-wechat-reply",
        PAGEURL: '/admin/wechatArticle/index',
        DELETEURL:'/admin/wechatArticle/delete',
        EDITURL:'/admin/wechatArticle/update',
        ADDURL: '/admin/wechatArticle/create',
        EDITTITLE: '编辑图文',
        ADDTITLE: '编辑图文',
        LAYERAREA: ['900px', '600px'],
        FORMSUBMIT: "zbc-wechat-submit",
        cols:[
           [
            {type:"checkbox"},
            {type:"numbers",title:"序号"},
            {field:"id",title:"编号"},
            {field:"title",title:"标题"},
            {field:"author",title:"作者"},
            {field:"useUrl",title:"使用链接",templet:"#table-content-enabled"},
            {
                title:"操作",
                toolbar:"#table-content-operation"
            }
           ]
        ]
    }).render();
 })

</script>